const axios = require('axios')

function sendMsgTemp(params) {
    return new Promise(async(resolve, reject) => {
        //定义请求地址
        const url = 'http://localhost:3000/api/sendMessage';
        // const url = 'http://localhost:3000/api/sendMsgToAll';
        //发送消息
        try {
            const result = await axios({
                method: 'post',
                url: url,
                data: params
            })
            resolve(result.data);
        } catch (error) {
            reject('请求出错' + error);
        }

    })
}